-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve AttributeError: 'ScalaFunction1' object has no attribute 'hashCode'. #184
base: master
Are you sure you want to change the base?
Conversation
vrb.addCheck(check) | ||
check.hasDataType("d", ConstrainableDataTypes.String, lambda x: x >= 1) | ||
vrb.addCheck(check) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to add and verify one by one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that is the use case for triggering the exception. If I change the test like so, it does not use hashCode
.
vrb = VerificationSuite(self.spark) \
.onData(self.df)
check = Check(self.spark, CheckLevel.Error, "Enough checks to trigger a hashCode not an attribute of ScalaFunction1")
check.addConstraints([
check.isComplete('b'),
check.containsEmail('email'),
check.isGreaterThanOrEqualTo("d", "b"),
check.isLessThanOrEqualTo("b", "d"),
check.hasDataType("d", ConstrainableDataTypes.String, lambda x: x >= 1)])
result = vrb.addCheck(check).run()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it only fail at the magic 5th one? It's a big strange if so.. btw CI is failing on this test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue write up has more info: #91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't replicate the error in CI but submitted an attempt to fix it.
Issue #, if available:
#91
Description of changes:
Added
hashCode()
method toScalaFunction1
andScalaFunction2
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.